package com.hlhj.carview.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hlhj.carview.LoadtNet
import com.hlhj.carview.R
import com.hlhj.carview.bean.JudgeListBean
import com.hlhj.carview.utils.TimeUtils

/**
 *NeverMore
 *2020/9/15
 **/
class JudgeListAdp(private val datas:ArrayList<JudgeListBean.Data>) :BaseQuickAdapter<JudgeListBean.Data,BaseViewHolder>(R.layout.news_detail_judge_item,datas){
    override fun convert(helper: BaseViewHolder?, item: JudgeListBean.Data?) {
        helper?.setText(R.id.itemName,item?.name)
        if (item?.icon.isNullOrEmpty()){
            helper?.getView<ImageView>(R.id.itemIcon)?.setImageResource(R.mipmap.head)
        }else{
            helper?.getView<ImageView>(R.id.itemIcon)?.LoadtNet(item?.icon?:"")
        }
        helper?.setText(R.id.itemContent,item?.content)
        helper?.setText(R.id.itemTime,TimeUtils.timeStamp2Date(item?.timeStamp?.toLong()?:0,"yyyy-MM-dd hh:mm:ss"))

    }
}